{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": false,
    "editable": false,
    "nbgrader": {
     "cell_type": "markdown",
     "checksum": "097296f545d3ec43da31eeb5627910ac",
     "grade": false,
     "grade_id": "cell-987c7a2f76744f44",
     "locked": true,
     "schema_version": 3,
     "solution": false,
     "task": false
    }
   },
   "source": [
    "# Introduction\n",
    "\n",
    "This first exercise is based on the python crashcourse offered by the department \"Nachrichtentechnik\" and \"Elektrische Messtechnik\".\n",
    "\n",
    "[Python Crash-Course](https://fgnt.github.io/python_crashkurs/#/)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {
    "deletable": false,
    "editable": false,
    "nbgrader": {
     "cell_type": "markdown",
     "checksum": "00a0926137f625aba2a4ec45dcc7e341",
     "grade": false,
     "grade_id": "cell-1fecd7143400f744",
     "locked": true,
     "schema_version": 3,
     "solution": false,
     "task": false
    }
   },
   "source": [
    "## MATLAB vs. Python\n",
    "\n",
    "|                             MATLAB                             |                                       Python                                       |\n",
    "|:--------------------------------------------------------------:|:----------------------------------------------------------------------------------:|\n",
    "|                           Commercial                           |                                    Open Source                                     |\n",
    "|     New functions via MATLAB Toolkits<br>(no package manager)     |        Installation of new modules with<br>package manager (conda or pip)         |\n",
    "| Mainly procedual programming<br>(Objects exists but are a hassle) |                                  Object oriented                                   |\n",
    "|               Mathematical Programming Language                |             General Purpose Language with<br>many mathematical modules              |\n",
    "|                No Namespaces for Core-Functions                |               Proper Namespaces (e.g. `plt.plot` instead of `plot`)                |\n",
    "|                          GUI included                          | Various GUIs available.<br>We recommend [vscode](https://code.visualstudio.com/) |\n",
    "|   Download: [Mathworks](https://de.mathworks.com/downloads/)   |              Download: [Anaconda](https://www.anaconda.com/download/)              |\n",
    "\n",
    "\n",
    "### Numpy for MATLAB users\n",
    "[https://docs.scipy.org/doc/numpy-1.15.0/user/numpy-for-matlab-users.html](https://numpy.org/doc/stable/user/numpy-for-matlab-users.html)\n",
    "\n",
    "## Common Libraries\n",
    "* Numpy (Vector and Matrix operations, Numeric computing)\n",
    "* Matplotlib (Plotting)\n",
    "* Pandas/Polars (Table operations)\n",
    "* Scikit-Learn (Machine Learning)\n",
    "* Tensorflow / PyTorch (Neural Networks)\n",
    "* SymPy (Symbolic computations)\n",
    "* Seaborn (Alternative Plotting)\n",
    "* ...\n",
    "\n",
    "## Quickstart\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "deletable": false,
    "editable": false,
    "nbgrader": {
     "cell_type": "code",
     "checksum": "03bcb8601af27e01b846001f23d7a243",
     "grade": false,
     "grade_id": "cell-bb8aab80ca0139e1",
     "locked": true,
     "schema_version": 3,
     "solution": false,
     "task": false
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "U_0 = 3     # V\n",
    "u_peak = 2  # V\n",
    "f_0 = 50    # 1/s\n",
    "\n",
    "# Timevector in s (Sequence of numbers)\n",
    "t = np.arange(start=0, stop=0.04, step=0.001)\n",
    "u = U_0 + u_peak * np.sin(2 * np.pi * f_0 * t)\n",
    "plt.plot(t, u, 'o--')\n",
    "plt.xlabel('Time $t$ / s')\n",
    "plt.ylabel('Voltage $u(t)$ / V')\n",
    "plt.grid(True)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
